Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSDK-2478: Update encoder driver methods #2161

Merged
merged 11 commits into from
Apr 11, 2023

Conversation

martha-johnston
Copy link
Contributor

@martha-johnston martha-johnston commented Apr 4, 2023

This covers RSDK-2477 (Add client and server files), RSDK-2478 (update driver methods), and RSDK-2479 (add encoder to registry), to make separate driver packages for single, incremental, and AMS encoders.

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Apr 4, 2023
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 4, 2023
@github-actions

This comment was marked as duplicate.

Copy link
Member

@npmenard npmenard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, have you tested the changes on hardware?

@martha-johnston
Copy link
Contributor Author

This PR is not ready yet I will update with a comment when it is. Realized I forgot to add a function.

Sorry that you already reviewed @npmenard, but yes I did test on hardware and will retest when I'm actually done!

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 6, 2023
@martha-johnston
Copy link
Contributor Author

Should be ready now but won't pass the checks until api changes are merged

@gvaradarajan gvaradarajan self-requested a review April 6, 2023 19:42
@gvaradarajan
Copy link
Member

sorry, I clicked approve on the wrong PR, I'm still reviewing

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 7, 2023
Copy link
Member

@gvaradarajan gvaradarajan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice job, just a couple requests.

}
)

type mock struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[if-minor] I think we can use inject.Encoder for this purpose; setupInjectRobot can return a state object with these fields that gets mutated by the injected methods via closure. Then you can check the values on the state in the tests. Helps with codebase consistency if everything is using inject, but if it turns out to be too much trouble don't force it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

leaving this as is for now

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 7, 2023
Copy link
Member

@randhid randhid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The really important change is in motor_encoder.go, the rest are optional and I agree with Gautham's comment about trying our best to not pass in protobuf structs.

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 7, 2023
@martha-johnston
Copy link
Contributor Author

@gvaradarajan @randhid I think I covered everything, but it resulted in a lot more changes so let me know if anything else comes up!

}
if !props[encoder.TicksCountSupported] {
return nil,
errors.New("cannot create an encoded motor without an encoder that has propery TicksCountSupported")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] typo + maybe add

Suggested change
errors.New("cannot create an encoded motor without an encoder that has propery TicksCountSupported")
errors.New("encoder type is %v need an encoder that supports Ticks for an encoded motor", props)

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 10, 2023
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 10, 2023
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Apr 10, 2023
@github-actions

This comment was marked as off-topic.

@randhid randhid requested a review from gvaradarajan April 11, 2023 15:41
@martha-johnston martha-johnston merged commit 0d617c6 into viamrobotics:main Apr 11, 2023
@martha-johnston martha-johnston deleted the rsdk-2478 branch April 20, 2023 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test This pull request is marked safe to test from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants